import React, { PropTypes } from 'react';
import { connect } from 'dva';
import styles from './Users.css';
import UserList from '../components/Users/UserList';

function Users({ location, dispatch, users }) {
  const {
    loading, list, total, current,
    currentItem, modalVisible, modalType,
    } = users;
  const userListProps = {
    dataSource: list,
    total,
    loading,
    current,
  };

  return (
    <div className={styles.normal}>
      <UserList {...userListProps} />
    </div>
  );
}


Users.propTypes = {
  users: PropTypes.object,
};

function mapStateToProps({ users }) {
  return { users };
}

export default connect(mapStateToProps)(Users);
